package com.xzy.controller.c;

import com.xzy.domain.dto.UserDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpHeaders;
import org.springframework.http.RequestEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 说明：域对象共享数据
 *
 * @author xzy
 * @date 2021/11/14 22:20
 */
@Slf4j
@RestController("controllerC")
@RequestMapping("/test_c")
public class TestController {

    @GetMapping("/a1")
    public void testA1(@RequestBody UserDTO userDTO) {
        log.info(userDTO.toString());
    }

    @GetMapping("/b1")
    public void testB1(RequestEntity<UserDTO> requestEntity) {
        HttpHeaders headers = requestEntity.getHeaders();
        UserDTO body = requestEntity.getBody();
        log.info("headers:{}", headers);
        log.info("body:{}", body);
    }

}
